home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Control Common / CBaseControl.cpp < prev    next >
Text File  |  1996-12-20  |  18KB  |  712 lines

  1. // =================================================================================
  2. //
  3. //    CBaseControl.cpp                ©1996 Microsoft Corporation All rights reserved.
  4. //
  5. // =================================================================================
  6.  
  7.  
  8. #include <stdio.h>
  9. #include <stdarg.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12.  
  13. #include "ocheaders.h"
  14. #include "debug.h"
  15. #include "CBaseControl.h"
  16. #include "register.h"    
  17. #include "ResourceMap.h"
  18. #include "dllentry.h"
  19.  
  20.  
  21. #define SafeReleaseAndNull(interface)    \
  22.     if (interface != NULL) {            \
  23.         interface->Release();            \
  24.         interface = NULL;                \
  25.     }
  26.  
  27. #define    DEFAULT_CONTROL_SIZE    50
  28.  
  29. #pragma mark === CBaseControl::Construction & Destruction ===
  30.  
  31. //=--------------------------------------------------------------------------=
  32. //    CBaseControl::CBaseControl
  33. //=--------------------------------------------------------------------------=
  34. //    Constructor
  35. //
  36. CBaseControl::CBaseControl(void)
  37. {
  38.     mUnkOuterP = NULL;
  39.     mContainerSiteP = NULL;
  40.     mContainerP = NULL;
  41.     mActive = false;
  42.     mCPContainerP = NULL;
  43.     mContextInfo = NULL;
  44.     mActiveContext = NULL;
  45.     mSize.h = mSize.v = DEFAULT_CONTROL_SIZE;
  46.     *mID = 0;
  47.  
  48.     mContextInfo = new LArray(sizeof(CBaseContextInfo*));
  49.     DLLAddRef();
  50. }
  51.  
  52.  
  53. //=--------------------------------------------------------------------------=
  54. //    CBaseControl::~CBaseControl
  55. //=--------------------------------------------------------------------------=
  56. //    Destructor
  57. //
  58. CBaseControl::~CBaseControl(void)
  59. {
  60.     if (mContextInfo)
  61.     {
  62.         ArrayIndexT            i = LArray::index_First;
  63.         CBaseContextInfo*    ContextInfoP;
  64.         while (mContextInfo->FetchItemAt(i++, &ContextInfoP))
  65.             delete ContextInfoP;
  66.         delete mContextInfo;
  67.         mContextInfo = NULL;
  68.     }
  69.  
  70.     StopIdling();
  71.     SafeReleaseAndNull(mContainerP);
  72.     SafeReleaseAndNull(mContainerSiteP);
  73.     SafeReleaseAndNull(mUnkOuterP);
  74.     SafeReleaseAndNull(mCPContainerP);
  75.     DLLRelease();
  76. }
  77.  
  78.  
  79. #pragma mark === CBaseControl::IUnknown ===
  80.  
  81. //=--------------------------------------------------------------------------=
  82. //    CBaseControl::IUnknown::QueryInterface
  83. //=--------------------------------------------------------------------------=
  84. //    Returns a pointer to the specified interface on a component to which a
  85. //    client currently holds an interface pointer.
  86. //
  87. STDMETHODIMP
  88. CBaseControl::QueryInterface(REFIID inRefID, void** outObj)
  89. {
  90.     ErrorCode    Result = CBaseCOM::QueryInterface(inRefID, outObj);
  91.  
  92.     if ( Result == E_NOINTERFACE )
  93.     {
  94.         void* pv = nil;
  95.  
  96.         if ( inRefID == IID_IObjectWithSite )
  97.             pv = (void*)(IObjectWithSite* ) this;
  98.         else if (inRefID == IID_IControl )
  99.             pv = (void*)(IControl*) this;
  100.         else if (inRefID == IID_IPersist || inRefID == IID_IPersistPropertyBag)
  101.             pv = (void*)(IPersistPropertyBag*) this;
  102.  
  103.         else if (inRefID == IID_IConnectionPointContainer) 
  104.         {
  105.             if ( mCPContainerP )
  106.                 return mCPContainerP->QueryInterface(IID_IConnectionPointContainer, outObj);
  107.         }
  108.  
  109.         *outObj = pv;
  110.  
  111.         // if we got an interface, ref it and return ok
  112.         if ( pv )
  113.         {
  114.              ((IUnknown*) pv)->AddRef();
  115.             Result = S_OK;
  116.         }
  117.     }
  118.     
  119.     return Result;
  120. }
  121.  
  122.  
  123.  
  124. #pragma mark === CBaseControl::IObjectWithSite ===
  125.  
  126. //=--------------------------------------------------------------------------=
  127. //    CBaseControl::IObjectWithSite::SetSite
  128. //=--------------------------------------------------------------------------=
  129. // informs the control of it's client site display
  130. // location within it's container
  131. //
  132. STDMETHODIMP
  133. CBaseControl::SetSite(IUnknown* inClientSite)
  134. {
  135.     // remove any idlers that have been set up
  136.     StopIdling();
  137.  
  138.     // Release the outer unknown
  139.     SafeReleaseAndNull(mUnkOuterP);
  140.  
  141.     // Set our outer unknown to the one provided
  142.     mUnkOuterP = (IUnknown*) inClientSite;
  143.  
  144.     // if we got a site, get the other interfaces we need.
  145.     if (mUnkOuterP != NULL)
  146.     {
  147.         // Only release these if we get called with a non-null inClientSite
  148.         // Should only ever get called with a null client site if the object
  149.         // is going away. Then these interfaces get released in the destructor.
  150.         SafeReleaseAndNull(mContainerSiteP);
  151.         SafeReleaseAndNull(mContainerP);
  152.  
  153.         // Add our reference to the unknown
  154.         mUnkOuterP->AddRef();
  155.  
  156.         // Get the IContainerSite interface    
  157.         mUnkOuterP->QueryInterface(IID_IContainerSite, &mContainerSiteP);
  158.  
  159.         // if we got that, get the IContainer interface
  160.         if ( mContainerSiteP )
  161.         {
  162.             mContainerSiteP->GetContainer(&mContainerP);
  163.             if ( mContainerP )
  164.                 mContainerP->AddRef();
  165.  
  166.             StartIdling();
  167.         }
  168.     }
  169.  
  170.     return S_OK;
  171. }
  172.  
  173.  
  174. //=--------------------------------------------------------------------------=
  175. //    CBaseControl::IObjectWithSite::GetSite
  176. //=--------------------------------------------------------------------------=
  177. // obtains a pointer to the controls client site.
  178. //
  179. STDMETHODIMP
  180. CBaseControl::GetSite(REFIID inRefID, void** outSite)
  181. {
  182.     if ( inRefID == IID_IUnknown )
  183.         *outSite = (void*) mUnkOuterP;
  184.     else if ( inRefID == IID_IContainerSite )
  185.         *outSite = (void*) mContainerSiteP;
  186.  
  187.     return S_OK;
  188. }
  189.  
  190.  
  191. #pragma mark === CBaseControl::IControl ===
  192.  
  193. //=--------------------------------------------------------------------------=
  194. //    CBaseControl::IControl::Draw
  195. //=--------------------------------------------------------------------------=
  196. STDMETHODIMP
  197. CBaseControl::Draw(DrawContext* inContext)
  198. {
  199.     if (inContext->DrawAspect != DVASPECT_CONTENT)
  200.         return DV_E_DVASPECT;
  201.  
  202.     return S_OK;
  203. }
  204.  
  205. //=--------------------------------------------------------------------------=
  206. //    CBaseControl::IControl::OnContextChange
  207. //=--------------------------------------------------------------------------=
  208. STDMETHODIMP
  209. CBaseControl::OnContextChange(UInt32 inContextID, ContextCommand inCommand)
  210. {
  211.     ErrorCode     Result = S_OK;
  212.  
  213.     CBaseContextInfo*    ContextInfo = GetContextInfoByID(inContextID);
  214.  
  215.     switch ( inCommand )
  216.     {
  217.         case AddContext:
  218.             if (!ContextInfo)
  219.             {
  220.                 if ((ContextInfo = NewContext(inContextID)) != NULL)
  221.                     mContextInfo->InsertItemsAt(1, 1, &ContextInfo);
  222.                 else
  223.                 {
  224. #if BE_STRICT
  225.                     DebugStr("\pAddContext couldn't get a context info object.");
  226. #endif    //    BE_STRICT
  227.                     Result = E_FAIL;
  228.                 }
  229.             }
  230.             else
  231.             {
  232. #if BE_STRICT
  233.                 DebugStr("\pAddContext with duplicate ContextID.");
  234. #endif    //    BE_STRICT
  235.                 Result = E_FAIL;
  236.             }
  237.             break;
  238.  
  239.         case RemoveContext:
  240.             if (ContextInfo)
  241.             {
  242.                 if (ContextInfo == mActiveContext)
  243.                     mActiveContext = NULL;
  244.  
  245.                 mContextInfo->RemoveItemsAt(1, mContextInfo->FetchIndexOf(&ContextInfo));
  246.                 delete ContextInfo;
  247.             }
  248.             else 
  249.             {
  250.                 Result = E_FAIL;
  251. #if BE_STRICT
  252.                 DebugStr("\pRemoveContext on a context the control doesn't have.");
  253. #endif    //    BE_STRICT
  254.             }
  255.  
  256.             break;
  257.  
  258.         case UpdateContext:
  259.             if (ContextInfo)
  260.                 ContextInfo->Update(false);
  261.             else
  262.             {
  263.                 Result = E_FAIL;
  264. #if BE_STRICT
  265.                 DebugStr("\pUpdateContext on a context the control doesn't have.");
  266. #endif    //    BE_STRICT
  267.             }
  268.             break;
  269.  
  270.         case ActivateContext:
  271.             if (ContextInfo)
  272.             {
  273.                 if (mActiveContext != NULL)
  274.                 {
  275.                     CBaseContextInfo*    ActiveContextInfo = GetContextInfoByID(inContextID);
  276.                     if (ActiveContextInfo)
  277.                         ActiveContextInfo->Deactivate(false);
  278.                     else
  279.                     {
  280.                         Result = E_UNEXPECTED;
  281. #if BE_STRICT
  282.                         DebugStr("\pCan't deactivate a context left active.");
  283. #endif    //    BE_STRICT
  284.                     }
  285. #if BE_STRICT
  286.                     DebugStr("\pActivateContext before a DeactivateContext.");
  287. #endif    //    BE_STRICT
  288.                 }
  289.                 Result = ContextInfo->Activate(false);
  290.                 mActiveContext = ContextInfo;
  291.             }
  292.             else
  293.             {
  294.                 Result = E_FAIL;
  295. #if BE_STRICT
  296.                 DebugStr("\pActivateContext on a context the control doesn't have.");
  297. #endif    //    BE_STRICT
  298.             }
  299.             break;
  300.  
  301.         case DeactivateContext:
  302.             if (ContextInfo)
  303.             {
  304.                 if (mActiveContext == ContextInfo)
  305.                     Result = ContextInfo->Deactivate(false);
  306.                 else
  307.                 {
  308.                     Result = E_UNEXPECTED;
  309. #if BE_STRICT
  310.                     DebugStr("\pDeactivateContext on an inactive context.");
  311. #endif    //    BE_STRICT
  312.                 }
  313.                 mActiveContext = NULL;
  314.             }
  315.             else
  316.             {
  317.                 Result = E_FAIL;
  318. #if BE_STRICT
  319.                 DebugStr("\pDeactivateContext on a context the control doesn't have.");
  320. #endif    //    BE_STRICT
  321.             }
  322.             break;
  323.  
  324.         default:
  325.             Result = E_FAIL;
  326.             break;
  327.     }
  328.  
  329.     return Result;
  330. }
  331.  
  332.  
  333. //=--------------------------------------------------------------------------=
  334. //    CBaseControl::IControl::GetID
  335. //=--------------------------------------------------------------------------=
  336. STDMETHODIMP
  337. CBaseControl::GetID(Int32 inBufferSize, Char8* outID)
  338. {
  339.     Int32    IDLen;
  340.     Char8*    Source;
  341.  
  342.     //    if we have an id then us it
  343.     if (*mID)
  344.     {
  345.         IDLen = *mID;
  346.         Source = (Char8*)(mID + 1);
  347.     }
  348.     //    otherwise use the hard coded registry name
  349.     else
  350.     {
  351.         Source = kOCXFullUserTypeName;
  352.         IDLen = strlen(Source);
  353.     }
  354.  
  355.     if (--inBufferSize < IDLen)
  356.         IDLen = inBufferSize;
  357.  
  358.     ::BlockMove(Source, outID, IDLen);
  359.     *(outID + IDLen) = '\0';
  360.  
  361.     return S_OK;
  362. }
  363.  
  364.  
  365. //=--------------------------------------------------------------------------=
  366. //    CBaseControl::IControl::GetUsedArea
  367. //=--------------------------------------------------------------------------=
  368. STDMETHODIMP
  369. CBaseControl::GetUsedArea(PlatformRegion* outUsedArea)
  370. {
  371. #pragma unused (outUsedArea)
  372.     return E_FAIL;
  373. }
  374.  
  375.  
  376. //=--------------------------------------------------------------------------=
  377. //    CBaseControl:IControl:SetFocus
  378. //=--------------------------------------------------------------------------=
  379. STDMETHODIMP
  380. CBaseControl::SetFocus(FocusCommand inCommand, FocusSet inFocus)
  381. {
  382. #pragma unused (inCommand, inFocus)
  383.     return E_FAIL;
  384. }
  385.  
  386.  
  387. //=--------------------------------------------------------------------------=
  388. //    CBaseControl::IControl::DoMouse    
  389. //=--------------------------------------------------------------------------=
  390. STDMETHODIMP
  391. CBaseControl::DoMouse(MouseEventType inMouseET, PlatformEvent* inEvent)
  392. {
  393. #pragma unused (inMouseET, inEvent)
  394.     return S_OK;
  395. }
  396.  
  397.  
  398. //=--------------------------------------------------------------------------=
  399. //    CBaseControl::IControl::DoKey    
  400. //=--------------------------------------------------------------------------=
  401. STDMETHODIMP
  402. CBaseControl::DoKey(KeyEventType inKeyET, Char8 inChar, PlatformEvent* inEvent)
  403. {
  404. #pragma unused (inKeyET, inChar, inEvent)
  405.     return S_OK;
  406. }
  407.  
  408.  
  409. //=--------------------------------------------------------------------------=
  410. //    CBaseControl:IControl:DoActivate    
  411. //=--------------------------------------------------------------------------=
  412. STDMETHODIMP
  413. CBaseControl::DoActivate(ActivateEventType inActiveET, UInt32 inContextID, PlatformEvent* inEvent)
  414. {
  415. #pragma unused (inContextID, inEvent)
  416.     switch (inActiveET)
  417.     {
  418.         case AppActivate:
  419.         case WindowActivate:
  420.             mActive = true;
  421.             break;
  422.         
  423.         case AppDeactivate:
  424.         case WindowDeactivate:
  425.             mActive = false;
  426.             break;
  427.     }
  428.     
  429.     return S_OK;
  430. }
  431.  
  432.  
  433. //=--------------------------------------------------------------------------=
  434. //    CBaseControl::IControl::DoSystemEvent    
  435. //=--------------------------------------------------------------------------=
  436. STDMETHODIMP
  437. CBaseControl::DoSystemEvent(PlatformEvent* inEvent)
  438. {
  439. #pragma unused (inEvent)
  440.     return S_OK;
  441. }
  442.  
  443.  
  444. //=--------------------------------------------------------------------------=
  445. //    CBaseControl::IControl::DoIdle    
  446. //=--------------------------------------------------------------------------=
  447. STDMETHODIMP
  448. CBaseControl::DoIdle(Uint32 IdleRefCon)
  449. {
  450. #pragma unused (IdleRefCon)
  451.     return S_OK;
  452. }
  453.  
  454.  
  455. #pragma mark === CBaseControl::IPersist ===
  456.  
  457. //=--------------------------------------------------------------------------=
  458. //    CBaseControl::IPersist::GetClassID
  459. //=--------------------------------------------------------------------------=
  460. //
  461. STDMETHODIMP
  462. CBaseControl::GetClassID(CLSID* ClassID)
  463. {
  464. #pragma unused (ClassID)
  465.     return E_NOTIMPL;
  466. }
  467.  
  468.  
  469. #pragma mark === CBaseControl::IPersistPropertyBag ===
  470.  
  471. //=--------------------------------------------------------------------------=
  472. //    CBaseControl::IPersistPropertyBag::InitNew
  473. //=--------------------------------------------------------------------------=
  474. //
  475. STDMETHODIMP
  476. CBaseControl::InitNew(void)
  477. {
  478.     //    BUGBUG:    Maybe do stuff here?
  479.     return S_OK;
  480. }
  481.  
  482.  
  483. //=--------------------------------------------------------------------------=
  484. //    CBaseControl::IPersistPropertyBag::Load
  485. //=--------------------------------------------------------------------------=
  486. //
  487. STDMETHODIMP
  488. CBaseControl::Load(IPropertyBag* PropertyBag, IErrorLog* ErrorLog)
  489. {
  490.     Int32        i;
  491.     VARIANT        v;
  492.  
  493.     v.vt = VT_BSTR;
  494.     v.bstrVal = NULL;
  495.  
  496.     //    get the starting size
  497.     if (PropertyBag->Read("width", &v, ErrorLog) == S_OK && v.bstrVal)
  498.     {
  499.         ::StringToNum((Uchar8*)v.bstrVal + sizeof(Uint32) - 1, &i);
  500.         mSize.h = i;
  501.         CoTaskMemFree(v.bstrVal);
  502.     }
  503.  
  504.     if (PropertyBag->Read("height", &v, ErrorLog) == S_OK && v.bstrVal)
  505.     {
  506.         ::StringToNum((Uchar8*)v.bstrVal + sizeof(Uint32) - 1, &i);
  507.         mSize.v = i;
  508.         CoTaskMemFree(v.bstrVal);
  509.     }
  510.  
  511.     if (PropertyBag->Read("id", &v, ErrorLog) == S_OK && v.bstrVal)
  512.     {
  513.         Int16    IDLen = *((Uint32*) v.bstrVal);
  514.  
  515.         if (IDLen > 255)
  516.             IDLen = 255;
  517.         ::BlockMove(v.bstrVal + sizeof(Uint32), mID + 1, IDLen);
  518.         *mID = IDLen;
  519.         CoTaskMemFree(v.bstrVal);
  520.     }
  521.  
  522.     return S_OK;
  523. }
  524.  
  525.  
  526. //=--------------------------------------------------------------------------=
  527. //    CBaseControl::IPersistPropertyBag::Save
  528. //=--------------------------------------------------------------------------=
  529. //
  530. STDMETHODIMP
  531. CBaseControl::Save(IPropertyBag* PropertyBag, BOOL ClearDirty, BOOL SaveAllProperties)
  532. {
  533. #pragma unused (PropertyBag, ClearDirty, SaveAllProperties)
  534.     return E_NOTIMPL;
  535. }
  536.  
  537.  
  538. #pragma mark === CBaseControl::Protected Methods ===
  539.  
  540. //=--------------------------------------------------------------------------=
  541. //    CBaseControl::InvalAllContexts
  542. //=--------------------------------------------------------------------------=
  543. //
  544. void
  545. CBaseControl::InvalAllContexts()
  546. {
  547.     Int16            Index = 1;
  548.     DrawContext        Context = {BeginPortType};
  549.     UInt32            ContextID;
  550.  
  551.     while (GetContextID(Index++, &ContextID))
  552.     {
  553.         if ( mContainerSiteP->AcquireContext(ContextID, &Context) == S_OK) 
  554.         {
  555.             if (Context.PortType == QDWindowPortType)
  556.                 ::InvalRect(&Context.Location);
  557.             mContainerSiteP->ReleaseContext(&Context);
  558.         }
  559.     }
  560. }
  561.  
  562.  
  563. //=--------------------------------------------------------------------------=
  564. //    CBaseControl::StartIdling [virtual]
  565. //=--------------------------------------------------------------------------=
  566. //
  567. Boolean8
  568. CBaseControl::StartIdling(void)
  569. {
  570.     return false;
  571. }
  572.  
  573.  
  574. //=--------------------------------------------------------------------------=
  575. //    CBaseControl::StartIdling [virtual]
  576. //=--------------------------------------------------------------------------=
  577. //
  578. Boolean8
  579. CBaseControl::StopIdling(void)
  580. {
  581.     if (mContainerSiteP)
  582.         return mContainerSiteP->SetIdleTime(RemoveAllIdlers, NULL) == S_OK;
  583.     else
  584.         return false;
  585. }
  586.  
  587.  
  588. //=--------------------------------------------------------------------------=
  589. //    CBaseControl::NewContext [virtual]
  590. //=--------------------------------------------------------------------------=
  591. //
  592. CBaseContextInfo*
  593. CBaseControl::NewContext(Uint32 inContextID)
  594. {
  595.     return new CBaseContextInfo(this, inContextID);
  596. }
  597.  
  598.  
  599. //=--------------------------------------------------------------------------=
  600. //    CBaseControl::GetContextID
  601. //=--------------------------------------------------------------------------=
  602. //
  603. Boolean8
  604. CBaseControl::GetContextID(Int16 inIndex, Uint32* outContextID)
  605. {
  606.     Boolean8            Result;
  607.     CBaseContextInfo*    ContextInfo = GetContextInfoByIndex(inIndex);
  608.  
  609.     if ((Result = ContextInfo != NULL) != false)
  610.         *outContextID = ContextInfo->GetContextID();
  611.  
  612.     return Result;
  613. }
  614.  
  615.  
  616. //=--------------------------------------------------------------------------=
  617. //    CBaseControl::GetContextInfoByID
  618. //=--------------------------------------------------------------------------=
  619. //
  620. CBaseContextInfo*
  621. CBaseControl::GetContextInfoByID(Uint32 inContextID)
  622. {
  623.     ArrayIndexT            Index = LArray::index_First;
  624.     CBaseContextInfo*    ContextInfo;
  625.  
  626.     while (mContextInfo->FetchItemAt(Index++, &ContextInfo))
  627.         if (ContextInfo && ContextInfo->GetContextID() == inContextID)
  628.             return ContextInfo;
  629.  
  630.     return NULL;
  631. }
  632.  
  633.  
  634. //=--------------------------------------------------------------------------=
  635. //    CBaseControl::GetContextInfoByIndex
  636. //=--------------------------------------------------------------------------=
  637. //
  638. CBaseContextInfo*
  639. CBaseControl::GetContextInfoByIndex(Int16 inIndex)
  640. {
  641.     CBaseContextInfo*    ContextInfo;
  642.  
  643.     if (!mContextInfo->FetchItemAt(inIndex, &ContextInfo))
  644.         ContextInfo = NULL;
  645.  
  646.     return ContextInfo;
  647. }
  648.  
  649.  
  650. #pragma mark === CBaseContextInfo Construction & Destruction ===
  651.  
  652. //=--------------------------------------------------------------------------=
  653. //    CBaseContextInfo::CBaseContextInfo
  654. //=--------------------------------------------------------------------------=
  655. //    Constructor
  656. //
  657. CBaseContextInfo::CBaseContextInfo(CBaseControl* inControlP, Uint32 ContextID)
  658. {
  659.     mContextID = ContextID;
  660.     mControlP = inControlP;
  661. }
  662.  
  663.  
  664. //=--------------------------------------------------------------------------=
  665. //    CBaseContextInfo::~CBaseContextInfo
  666. //=--------------------------------------------------------------------------=
  667. //    Destructor
  668. //
  669. CBaseContextInfo::~CBaseContextInfo(void)
  670. {
  671. }
  672.  
  673.  
  674. #pragma mark === CBaseContextInfo Stub Implementation ===
  675.  
  676. //=--------------------------------------------------------------------------=
  677. //    CBaseContextInfo::Update
  678. //=--------------------------------------------------------------------------=
  679. //    Update 
  680. //
  681. ErrorCode
  682. CBaseContextInfo::Update(Boolean8 Acquired)
  683. {
  684. #pragma unused (Acquired)
  685.     return S_OK;
  686. }
  687.  
  688. //=--------------------------------------------------------------------------=
  689. //    CBaseContextInfo::Activate
  690. //=--------------------------------------------------------------------------=
  691. //    Activate 
  692. //
  693. ErrorCode
  694. CBaseContextInfo::Activate(Boolean8 Acquired)
  695. {
  696. #pragma unused (Acquired)
  697.     return S_OK;
  698. }
  699.  
  700.  
  701. //=--------------------------------------------------------------------------=
  702. //    CBaseContextInfo::Deactivate
  703. //=--------------------------------------------------------------------------=
  704. //    Deactivate 
  705. //
  706. ErrorCode
  707. CBaseContextInfo::Deactivate(Boolean8 Acquired)
  708. {
  709. #pragma unused (Acquired)
  710.     return S_OK;
  711. }
  712.